/*    *//*
 package com.gillion.grule.client.logger.utils;
*/
/*    *//*

*/
/*    *//*
 import com.google.common.collect.Maps;
*/
/*    *//*
 import java.util.HashMap;
*/
/*    *//*
 import java.util.Properties;
*/
/*    *//*
 import org.apache.commons.lang3.StringUtils;
*/
/*    *//*
 import org.apache.kafka.clients.producer.KafkaProducer;
*/
/*    *//*
 import org.slf4j.Logger;
*/
/*    *//*
 import org.slf4j.LoggerFactory;
*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*
 public class KafkaProducerFactory
*/
/*    *//*
 {
*/
/* 19 *//*
   private static HashMap<String, KafkaProducer> producers = Maps.newHashMap();
*/
/* 20 *//*
   private static final Logger LOGGER = LoggerFactory.getLogger(KafkaProducerFactory.class);
*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*
   public static KafkaProducer getInstance(String topic) {
*/
/* 28 *//*
     if (producers.isEmpty()) {
*/
/* 29 *//*
       throw new RuntimeException("producer map is empty,pls call KafkaProducerFactory.initProducer() first!");
*/
/*    *//*
     }
*/
/* 31 *//*
     if (!producers.containsKey(topic))
*/
/*    *//*
     {
*/
/* 33 *//*
       throw new RuntimeException("topic is not exist:".concat(topic));
*/
/*    *//*
     }
*/
/* 35 *//*
     return producers.get(topic);
*/
/*    *//*
   }
*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*
   public static void initProducer(Properties config) {
*/
/* 43 *//*
     String topicConfig = config.getProperty("topic");
*/
/* 44 *//*
     if (StringUtils.isEmpty(topicConfig)) {
*/
/* 45 *//*
       throw new RuntimeException("topic is empty");
*/
/*    *//*
     }
*/
/* 47 *//*
     String[] topics = topicConfig.split(",");
*/
/* 48 *//*
     for (String topic : topics) {
*/
/* 49 *//*
       producers.put(topic, new KafkaProducer(config));
*/
/* 50 *//*
       if (LOGGER.isDebugEnabled())
*/
/* 51 *//*
         LOGGER.debug("INIT PRODUCER: TOPIC:" + topic);
*/
/*    *//*
     }
*/
/*    *//*
   }
*/
/*    *//*
 }


*/
/* Location:              D:\apache-tomcat-9.0.76\webapps\grule-manager\WEB-INF\lib\grule-client-2.0.2.RELEASE.jar!\com\gillion\grule\client\logge\\utils\KafkaProducerFactory.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */
